//
//  UIBarButtonItem+Extension.swift
//  SwiftWB
//
//  Created by 吴志勇 on 2019/6/17.
//  Copyright © 2019 wzy. All rights reserved.
//

import UIKit

extension UIBarButtonItem
{
    convenience init(imageName:String,target: AnyObject?, action: Selector) {
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), for: .normal)
        btn.setImage(UIImage(named:imageName + "_highlighted"), for: .highlighted)
        btn.sizeToFit()
        btn.addTarget(target, action: action, for: .touchUpInside)
        self.init(customView: btn)
    }
}
